package com.huike.web.controller.business;

import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.domain.vo.BusinessOpportunityFollowUp;
import com.huike.business.service.ITbBusinessTrackRecordService;
import com.huike.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huike.common.core.controller.BaseController;

import java.util.List;

/**
 * 商机跟进记录Controller
 *
 * @date 2021-04-28
 */
@RestController
@RequestMapping("/business/record")
public class TbBusinessTrackRecordController extends BaseController {

    @Autowired
    private ITbBusinessTrackRecordService ines;

    //    商机跟进查询
    @GetMapping("list")
    public AjaxResult list(Long businessId) {
        List<BusinessOpportunityFollowUp> list = ines.selectBusinessTrackRecord(businessId);
        return new AjaxResult(200, "操作成功", list);
    }

    //添加商机跟进记录
    @PostMapping
    public AjaxResult add(@RequestBody BusinessOpportunityFollowUp businessOpportunityFollowUp) {
        ines.add(businessOpportunityFollowUp);
        return new AjaxResult(200, "操作成功");
    }

}
